<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<style type="text/css">
.selectWidth2 {
	width: 215px;
}

.selectWidth1 {
	width: 298px;
}
.treeAndCompleteWidth {
   width: 185px;
}
</style>
<x:parse xml="${param.xmlstr}" var="xmlData" />
<table class="t_css table01" width="100%" border="0" cellpadding="0"
	id="basicInfo" cellspacing="1">
	<tr>
		<td colspan="6" class="t_bar">&nbsp;项目基本信息</td>
	</tr>
	<tr>
		<td nowrap width="111" align="right"><span class="color_red">*</span>项目名称：</td>
		<td nowrap colspan="5"><input id="zh_title"
			name="proposal/zh_title" label="项目名称" type="text"  maxlength="50"
			class="input_css required" style="width: 710px;" 
			value="<x:out select="$xmlData/data/proposal/zh_title" />" /></td>
	</tr>
	<tr>
		<td nowrap width="111" align="right"><span class="color_red">*</span>技术方向：</td>
	           <td nowrap valign="middle" colspan="5">
	              <c:set var="direction_value"><x:out select="$xmlData/data/proposal/direction_value" /></c:set>
			      <c:set var="direction_params">
			             {'grant_code':'<x:out select="$xmlData/data/proposal/grant_code" />','stat_year':'${statYear}'}			 
			      </c:set> 
			      <input name="proposal/direction_value" type="hidden" 
			             value="<x:out select="$xmlData/data/proposal/direction_value" />"
			             class="required " label="技术方向" /> 
			      <input name="proposal/direction_name" type="hidden"
			             value="<x:out select="$xmlData/data/proposal/direction_name" />" />
			      <cpt:select id="direction" key="applicant_subject"
				         
				         onChange="initControlValue('direction')"
				         value="${direction_value}" sqlParamVal="${direction_params}"></cpt:select>
		       </td>
	</tr>
	<tr>
		<td nowrap align="right"><span class="color_red">*</span>申报日期：</td>
		<td nowrap colspan="5">
		    <c:set var="submit_date">
			    <x:out select="$xmlData/data/proposal/submit_date" />
			</c:set> 
			    <cpt:date id="submit_date" name="proposal/submit_date"
				value="${submit_date}" size="33" className="required date"
				label="申报日期"></cpt:date>
		&nbsp;</td>	
	</tr>

    <tr>
		<td nowrap align="right"><span class="color_red">*</span>开始日期：</td>
		<td nowrap colspan="2"><c:set var="start_date">
				<x:out select="$xmlData/data/proposal/start_date" />
			</c:set> <cpt:date id="start_date" name="proposal/start_date"
				value="${start_date}" size="33"
				className="required date  dateCompare:end_date" label="开始日期"></cpt:date>

		</td>
		<td nowrap align="right"><span class="color_red">*</span>结束日期：</td>
		<td nowrap colspan="2"><c:set var="end_date">
				<x:out select="$xmlData/data/proposal/end_date" />
			</c:set> <cpt:date id="end_date" name="proposal/end_date"
				className="required date" label="结束日期" size="33"
				value="${end_date}"></cpt:date></td>

	</tr>
	
    <tr>
		<td nowrap align="right"><span class="color_red">*</span>一级学科：</td>
		<td nowrap colspan="2">
		     <input type="hidden"  label="一级学科" class="required" id="firstTechValue" name="proposal/first_tech_value"  value="<x:out select="$xmlData/data/proposal/first_tech_value" />"/>
		     <input type="hidden"  id="firstTechName" name="proposal/first_tech_name"  value="<x:out select="$xmlData/data/proposal/first_tech_name" />"/>
		     <select id="first_tech" name="first_tech" onChange="initControlValue('first_tech');changeFirstTech()"  width="150px">
		        <option value=""></option>
		     </select>
		</td>
		<td nowrap align="right" nowrap><span class="color_red">*</span>二级学科：</td>
		<td nowrap colspan="2">
		    <input type="hidden"  label="二级学科" class="required" id="secondTechValue" name="proposal/second_tech_value"  value="<x:out select="$xmlData/data/proposal/second_tech_value" />"/>
		    <input type="hidden"  id="secondTechName" name="proposal/second_tech_name"  value="<x:out select="$xmlData/data/proposal/second_tech_name" />"/>
		    <select id="second_tech" name="second_tech" onChange="initControlValue('second_tech')" width="150px">
		         <option value=""></option>
		    </select>
		</td>
	</tr>
	
	
	<tr>
		<td nowrap align="right"><span class="color_red">*</span>项目联系人：</td>
		<td nowrap colspan="1"><input id="contact_psn_cname"
			name="proposal/contact_psn_cname" label="项目联系人" type="text" required
			class="input_css required" style="width: 100px;"
			maxlength="50"
			value="<x:out select="$xmlData/data/proposal/contact_psn_cname" />" />
		</td>
		<td nowrap align="right"><span class="color_red">*</span>联系电话：</td>
		<td nowrap colspan="1"><input id="contact_psn_tel"
			name="proposal/contact_psn_tel" label="联系人电话" type="text" required
			class="input_css required" style="width: 120px;"   maxlength='15'
			value="<x:out select="$xmlData/data/proposal/contact_psn_tel" />" />
		</td>
		<td nowrap align="right"><span class="color_red">*</span>手机：</td>
		<td nowrap colspan="1"><input id="contact_psn_mobile"
			name="proposal/contact_psn_mobile" label="联系人手机" type="text" required
			class="input_css required mobile" style="width: 120px;" maxlength="11" 
			value="<x:out select="$xmlData/data/proposal/contact_psn_mobile" />" />
		</td>
	</tr>
	
</table>

<script type="text/javascript">
$(document).ready (function() {
	//初始化所属一级学科
	var firstTechCode=$("[name='proposal/first_tech_value']").val();
	var firstTechValue="";
	if(firstTechCode != "")//如果有值
		firstTechValue = firstTechCode;
	var firstTechParams = {"key":"tech_domain1","cacheable":"false","sqlParamVal":""};
 	loadAjaxSelect("first_tech",ctx+"/cpt/ajaxload-select",firstTechParams,firstTechValue);
	//初始化所属二级学科
	var secondTechValue="";
 	var secondTechCode=$("[name='proposal/second_tech_value']").val();
 	if(secondTechCode != "")//如果有值
 		secondTechValue = secondTechCode;
	if($.isNumeric(secondTechCode)){
 		var secondTechParams = {"key":"tech_domain2","cacheable":"false","sqlParamVal":"{'code':'"+secondTechCode+"%'}"};
		loadAjaxSelect("second_tech",ctx+"/cpt/ajaxload-select",secondTechParams,secondTechValue);
	}
	$("#first_tech").addClass("selectWidth2");
	$("#second_tech").addClass("selectWidth2");
});
    
    
function changeFirstTech() {

	var value = $("#first_tech option:selected").val();
	//var name = $("#first_tech option:selected").text();
	$("#second_tech").empty();
	$("#second_tech").append("<option value=''></option>");
	$("[name^='proposal/second_tech_']").val("");
	// ajax加载附注说明
	var secondTechParams = {
		"key" : "tech_domain2",
		"cacheable" : "false",
		"sqlParamVal" : "{'code':'" + value + "%'}"
	};
	loadAjaxSelect("second_tech", ctx + "/cpt/ajaxload-select",secondTechParams);
}
</script>